{% extends 'base_main.html' %}
{% load static %}
{% block ext_css %}
    {{ block.super }}
    <link rel="stylesheet" href="{% static 'axf/main/css/market.css' %}">
{% endblock %}


{% block ext_js %}
    {{ block.super }}
    {#    添加点击分类展示的点击事件#}
    <script type="text/javascript" src="{% static 'axf/main/js/market.js' %}"></script>
{% endblock %}
{% block content %}
    <div id="market">

        {#    左边大类型导航#}
        <aside>
            <ul>
                {% for foodtype in foodtypes %}
                    <li>
                        <a href="{% url 'axf:market_with_params' typeid=foodtype.typeid childcid=0 order_rule=5%} ">
                            {{ foodtype.typename }}
                            {% ifequal foodtype.typeid typeid %}
                                <span class="yellowSlide"></span>
                            {% endifequal %}
                        </a>
                    </li>
                {% endfor %}
            </ul>
        </aside>


        <section>
            <nav>
                <ul>
                    <li id="all_types"><span>全部分类<span class="glyphicon glyphicon-chevron-down"></span></span></li>
                    <li id="sort_rule"><span>综合排序<span class="glyphicon glyphicon-chevron-down"></span></span></li>
                </ul>
            </nav>
            <menu>
                <ul>
                    {% for goods_list in goods_lists %}
                        <li>
                            <a href="#">
                                <img src="{{ goods_list.productimg }}" alt="{{ goods_list.productlongname }}">
                                <div class="shoppingInfo">
                                    <h6>{{ goods_list.productlongname }}</h6>
                                    <p class="detailTag">
                                        <span>精选</span>
                                    </p>
                                    <p class="unit">{{ goods_list.specifics }}</p>
                                    <p class="price">
                                        <span>{{ goods_list.price }}</span>
                                        <s>{{ goods_list.marketprice }}</s>
                                    </p>
                                </div>
                            </a>
                            <section>
                                <button class="subShopping">-</button>
                                <span>0</span>
                                <button goodsid = "{{ goods_list.id }}" class="addShopping">+</button>
                            </section>
                        </li>
                    {% endfor %}
                </ul>
                <div id="all_types_container">
                    <div>
                        {% for foodtypechildname_list in foodtypechildname_list_lists %}
                            {% ifequal foodtypechildname_list.1 childcid %}
                                <a href="{% url 'axf:market_with_params' typeid=typeid childcid=foodtypechildname_list.1 order_rule=5%}">
                                    <button class="btn btn-success">{{ foodtypechildname_list.0 }}</button>
                                </a>
                            {% else %}
                                <a href="{% url 'axf:market_with_params' typeid=typeid childcid=foodtypechildname_list.1 order_rule=5%}">
                                    <button class="btn btn-default">{{ foodtypechildname_list.0 }}</button>
                                </a>
                            {% endifequal %}
                        {% endfor %}
                    </div>
                </div>
                <div id="sort_container">
                    <div>
                        {% for order_rule in order_rule_list %}

                            {% ifequal order_rule_now order_rule.1 %}
                                <a href="{% url 'axf:market_with_params' typeid=typeid childcid=childcid order_rule=order_rule.1 %}">
                                    <button class="btn btn-success">{{ order_rule.0 }}</button>
                                </a>
                            {% else %}
                                <a href="{% url 'axf:market_with_params' typeid=typeid childcid=childcid order_rule=order_rule.1 %}">
                                    <button class="btn btn-default">{{ order_rule.0 }}</button>
                                </a>
                            {% endifequal %}

                        {% endfor %}
                    </div>
                </div>
            </menu>
        </section>
    </div>
{% endblock %}